package IOMyhead;

import java.io.*;

public class B2T {
    public static void main(String[] args) {
        File file1 = new File("C:\\Users\\wangzihong\\Desktop\\20175209\\课上练习及课下作业\\src\\IOMyhead","20175209.bin");
        File file2 = new File("C:\\Users\\wangzihong\\Desktop\\20175209\\课上练习及课下作业\\src\\IOMyhead","20175209_1.txt");
        String s = "";
        String out1="";
        int i=1;
        try {
            Reader in = new FileReader(file1);
            BufferedReader bufferRead = new BufferedReader(in);
            Writer out = new FileWriter(file2);
            BufferedWriter bufferWrite = new BufferedWriter(out);
            while((s = bufferRead.readLine())!=null) {
                out1 = i + "" + "  "+ Integer.parseInt(s,2);
                i++;
                bufferWrite.write(out1);
                bufferWrite.newLine();
            }
            bufferWrite.close();;
            out.close();;
        }
        catch (Exception e) {}
    }
}
